<?php

declare(strict_types=1);
/*
 * This file is part of Leonsw.
 *
 * @link     https://leonsw.com
 * @document https://docs.leonsw.com
 * @contact  leonsw.com@gmail.com
 * @license  https://leonsw.com/LICENSE
 */
namespace App\Resource\Lottery3\User;


use Illuminate\Http\Resources\Json\JsonResource;

class UserBalanceResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            "id" => $this->user_id,
            "code" => $this->user_data->user_code ?? 0,
            "nickname" => $this->user_data->nickname ?? '',
            "avatar" => $this->user_data-> head_picture ?? '',
            "gender" => $this->user_data->sex ?? 0,
            "balance" => $this->lottery3->balance ?? 0,
            "coin" => $this->money ?? 0,
            "count" => $this->lottery3->count ?? 0,
        ];
    }
}
